import { createRouter, createWebHistory } from 'vue-router';
import type { App } from 'vue';
import { staticRoutes } from '@/router/routes.ts';
import { setUpRouterGuards } from '@/guard';

export const router = createRouter({
  history: createWebHistory(),
  routes: staticRoutes,
});

export function setUpRouter(app: App) {
  // 装载路由守卫
  setUpRouterGuards();

  app.use(router);
}
